package com.ywu.application.standard.fileSys.api;

import com.ywu.common.result.CommonResult;
import com.ywu.application.standard.fileSys.dto.YwuFileWhiteListDto;
import com.ywu.application.standard.fileSys.entity.YwuFileWhiteListEntity;
import com.ywu.application.standard.fileSys.service.YwuFileWhiteListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName YwuFileWhiteListApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2024/8/17 8:17
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/file/sys/whiteList")
public class YwuFileWhiteListApi {
    @Autowired
    private YwuFileWhiteListService service;

    /**
    * @Author GroundDemo
    * @Description 分页查询白名单列表
    * @Date 8:33 2024/8/17
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/ywu.file.white.list.page.list")
    public CommonResult<Object> queryPageList(@RequestBody YwuFileWhiteListDto dto) {
        return service.queryPageList(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 根据appId查询所有的白名单
    * @Date 8:37 2024/8/17
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.util.List<com.ywu.file.sys.standard.entity.YwuFileWhiteListEntity>>
    **/
    @PostMapping("/ywu.file.white.list.query.app")
    public CommonResult<List<YwuFileWhiteListEntity>> queryWhiteListByAppId(@RequestBody YwuFileWhiteListDto dto) {
        return service.queryWhiteListByAppId(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 添加应用文件白名单
    * @Date 8:40 2024/8/17
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/ywu.file.white.list.add.info")
    public CommonResult<Object> addWhiteListInfo(@RequestBody YwuFileWhiteListDto dto) {
        return service.addWhiteListInfo(dto);
    }

    /**
     * @Author GroundDemo
     * @Description 修改应用文件白名单
     * @Date 8:40 2024/8/17
     * @Param [dto]
     * @return com.ywu.common.result.CommonResult<java.lang.Object>
     **/
    @PostMapping("/ywu.file.white.list.update.info")
    public CommonResult<Object> updateWhiteListInfo(@RequestBody YwuFileWhiteListDto dto) {
        return service.updateWhiteListInfo(dto);
    }

    /**
     * @Author GroundDemo
     * @Description 删除应用文件白名单
     * @Date 8:40 2024/8/17
     * @Param [dto]
     * @return com.ywu.common.result.CommonResult<java.lang.Object>
     **/
    @PostMapping("/ywu.file.white.list.delete.info")
    public CommonResult<Object> deleteWhiteListInfo(@RequestBody YwuFileWhiteListDto dto) {
        return service.deleteWhiteListInfo(dto);
    }

}
